/**
 * @file
 * @author Filipe Mutz
 *
 * @section DESCRIPTION
 * This file contains the definition of all filters
 */

#ifndef _NN_LIB_FILTERS_H_
#define _NN_LIB_FILTERS_H_

#include <opencv/cv.h>
#include <opencv/highgui.h>
#include "global.h"
#include "image.h"

using namespace brain::image;
using namespace brain::global;

namespace brain
{
	namespace filter
	{
		class LogPolarFilter
		{
			int SERENO_MODEL;
			int C1;
			double pi;
			double LOG_POLAR_SCALE_FACTOR;
			float y0_val;

			double distance_from_image_center (int wi, int hi, int w, int h, int u, double log_factor);
			double map_v1_to_image_angle (int u, int v, int w, int h);
			void map_v1_to_image(int *xi, int *yi, int wi, int hi, int u, int v, int w, int h, int x_center, int y_center, double correction, double log_factor);

			public:

				LogPolarFilter();
				~LogPolarFilter();

				/**
				 * This function transform an image to its log polar representation
				 *
				 * @param input image
				 * @param output image
				 * @param x-coordinate of the log polar center
				 * @param y-coordinate of the log polar center
				 * @return void
				 */

				void transform(GrayscaleImage &img, GrayscaleImage &output_img, int x, int y);
				void transform(ColorImage &img, ColorImage &output_img, int x, int y);
		};
	}
}

#endif
